package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.blockHandler.HotspotBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HotspotController {

    @GetMapping("/hotspot")
    @SentinelResource(value = "hotspotResource", blockHandler = "hotSpotBlockHandler",
            blockHandlerClass = HotspotBlockHandler.class)
    public String hotspot(@RequestParam(value = "userId", required = false) String userId,
                          @RequestParam(value = "shopId", required = false) String shopId) {
        String msg = "进入hotspot";
        System.out.println(msg);
        return msg;
    }
}
